package com.fili;

import com.fili.core.params.DryParams;
import com.fili.gui.JDryMainFrame;

import javax.swing.*;
import java.io.PrintWriter;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 14, 2006
 * Time: 11:48:01 AM
 */
public class JDryMain
{
    public static final int DEMO_DAYS = 30;

    public static DryParams params;
    public static PrintWriter errorWriter;

    public static void main(String[] args)
    {
        try
        {
//            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
        }
        catch (ClassNotFoundException e)
        {
            e.printStackTrace();
        }
        catch (InstantiationException e)
        {
            e.printStackTrace();
        }
        catch (IllegalAccessException e)
        {
            e.printStackTrace();
        }
        catch (UnsupportedLookAndFeelException e)
        {
            e.printStackTrace();
        }

        params = DryParams.getDryParams("params.dat");

/*        if (params.registeredName.trim().length() == 0)
{
String message;
boolean canRun = false;

if (params.firstRun == 0)
params.firstRun = System.currentTimeMillis();

if (System.currentTimeMillis() < params.lastRun)
message = "Copia dumneavoastra a expirat din cauza schimbarii datei";
else
{
params.lastRun = System.currentTimeMillis();
long days = (params.lastRun - params.firstRun) / (1000 * 60 * 60 * 24);
if (days < DEMO_DAYS)
{
    message = "Mai aveti inca " + (DEMO_DAYS - days) + ((DEMO_DAYS - days > 1) ? " zile" : " zi") + " de evaluare";
    canRun = true;
}
else
    message = "Copia dumneavoastra a expirat";

}
JButton[] btn = new JButton[3];
btn[0] = new JButton("Start");
btn[1] = new JButton("Quit");
btn[2] = new JButton("Register");
new RegisterMessageDialog(message, canRun);
}
else        */
        new JDryMainFrame();
    }
}
